﻿@model IEnumerable<GameSchoolApplication.Models.Game>

@{
    ViewBag.Title = "Listi yfir leiki";
	Layout = "~/Views/Shared/_AdministratorLayout.cshtml"; 
}
<section id="Index">
<h2>Listi yfir leiki</h2>

<p>
    @Html.ActionLink("Skrá nýjan leik", "Create")
</p>
<table class="IndexTable">
    <tr>
        <th>
            Nafn
        </th>
        <th>
            Lýsing
        </th>
        <th>
            Höfundur
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @item.Title
        </td>
        <td>
            @item.Description
        </td>
        <td>
            @item.Author.Name
        </td>
        <td>
            @Html.ActionLink("Breyta", "Edit", new { id=item.GameId }) |
            @Html.ActionLink("Nánar", "Details", new { id=item.GameId }) |
            @Html.ActionLink("Eyða", "Delete", new { id=item.GameId })
        </td>
    </tr>
}

</table>
</section>